package 创建者模式.工厂模式.p04_工厂方法模式;



/**
 * @Description TODO
 * @Author shallow
 * @Date 2023/3/3 11:12
 */

public class CoffeeStore {
    private AbstractCoffeeFactory coffeeFactory;
    public void setCoffeeFactory(AbstractCoffeeFactory coffeeFactory){
        this.coffeeFactory=coffeeFactory;
    }
    public Coffee orderCoffee(){
        Coffee coffee = coffeeFactory.createCoffee();
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
